from base import Base
from selenium.webdriver.common.by import By

class page1(Base):
    #父子
    def test_father(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().className("android.widget.LinearLayout").instance(73).childSelector(index(4))')
        ele=self.find_ele(loc)
        return ele
    #兄弟
    def test_bother(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.kongfz.app:id/ll_nav1.formParent(index(4))")')
        ele=self.find_ele(loc)
        return ele
    # ANDROID_UIAUTOMATOR
    def test_sousuokuang(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.kongfz.app:id/ll_search")')
        ele=self.find_ele(loc)
        return ele
    #class name
    def test_shuru(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    # id
    def test_anniu(self):
        loc=(By.ID,'com.kongfz.app:id/rlSearch')
        ele=self.find_ele(loc)
        return ele
    # test
    def test_xiyouji(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("西游记（全二册）")')
        ele=self.find_ele(loc)
        return ele
    # XPATH
    def test_shop(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tvGoods"]')
        ele=self.find_ele(loc)
        return ele
